CC = g++
LD = g++
prog = libsocket_cpp.so
SRC = \
      blocking_policy.h \
      locking_policy.cpp \
      locking_policy.h \
      lost_connection_exception.h \
      no_blocking_policy.cpp \
      no_blocking_policy.h \
      no_error_policy.h \
      no_locking_policy.h \
      socket.h \
      socket_exception.h \
      throwing_error_policy.h 
OBJ = \
      no_blocking_policy.o \
      locking_policy.o 

LDFLAGS = -lboost_thread  -shared
CFLAGS = -g -fPIC -DPIC -fvar-tracking

all: $(prog)

${prog}: $(OBJ)
	$(LD) $(LDFLAGS) $(OBJ) -o $(prog)

%.o: %.cpp
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm *.o
	rm $(prog)

run:
	./$(prog)
